﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="JsTest.aspx.cs" Inherits="JsTest" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>rpcfx js-client test</title>
    <script language="javascript" type="text/javascript" src="js/qajax.js"></script>
    <script language="javascript" type="text/javascript" src="js/rpcfx.js"></script>
    <script language="javascript" type="text/javascript">
        var i = 10;
        function test()
       {

            var serviceName = "nrpcfx.test.Itest";
            var methodName  = "doit";
            var paramTypeNames = ["int"];
            var args = [i ++];
            
            var xml = createRequest(serviceName,methodName,paramTypeNames,args);
            $("x").innerText += "\n" + new Date().toLocaleString() + ":\n【客户端调用】" + serviceName + "." + methodName + "(" + args.join(",") + ")";
            $("x").innerText += "\n" + new Date().toLocaleString() + ":\n" + xml;
            
            var result = ajaxCall(_server,"param=" + xml,true);
            if(!result) alert("null");
            $("r").innerText += "\n" + new Date().toLocaleString() + ":\n【服务器端返回】" + result.childNodes[0].childNodes[0].text; 
            $("r").innerText += "\n" + new Date().toLocaleString() + ":\n" + result.xml;
        
       }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <input type="button" value="ajaxCall" onclick="test()" />
    <div id="x" style="height:87%;left:12px; width:45%; background-color:#c0f0f0; position:absolute; top: 55px; overflow:scroll;">
    
    </div>
    
    <div id="r" style="height:87%; left:594px; width:45%; background-color:#c0f0f0; position:absolute; top: 55px;overflow:scroll;">
    
    </div>
    </form>
</body>
</html>
